<template>
  <div class="container" @click="handleClick">
    <div class="container-img">
      <swiper :options="swiperOption">
        <!-- slides -->
        <swiper-slide class="swiper" v-for="(item,i) in imgs" :key="i">
          <img :src="item" alt class="gallary-img">
        </swiper-slide>

        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      flag: false,
      swiperOption: {
        pagination: ".swiper-pagination",
        paginationType: "fraction",
        observeParents: true,
        observer: true
      }
    };
  },
  methods: {
    handleClick() {
      this.$emit('gallaryClose')
    }
  },
  props: {
    imgs: Array
  }
};
</script>
<style lang="stylus" scoped>
.container >>> .swiper-container {
  overflow: inherit;
}

.container {
  z-index: 99;
  position: fixed;
  display: flex;
  flex-direction: column;
  justify-content: center;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #000;

  .container-img {
    height: 0;
    padding-bottom: 100%;
    width: 100%;

    img {
      width: 100%;
    }

    .swiper-pagination {
      color: #fff;
      bottom: -1rem;
    }
  }
}
</style>